package com.dao;

import com.bean.Express;
import com.bean.User;
import com.exception.DuplicateCodeException;
import com.exception.DuplicateUserPhoneException;

import java.util.List;
import java.util.Map;

public interface BaseUserDao {
    List<Map<String, Integer>> console();

    List<User> findAll(boolean limit, int offset, int pageNumber);

    User findByPhone(String userPhone);

    //Express findByCode(String code);

    //List<Express> findByUserPhone(String userPhone);

    //List<Express> findBySysPhone(String sysPhone);

    boolean insert(User user) throws DuplicateUserPhoneException;

    boolean insert(String userPhone) throws DuplicateUserPhoneException;

    boolean update(int id, User user) throws DuplicateUserPhoneException;

    boolean updateLastLoginTime(String userPhone);

    boolean delete(int id);
}
